package exam.bak.meituan;

import java.math.BigInteger;
import java.util.Scanner;

public class P1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String bigNum = scanner.nextLine().trim();
        int total = 0;
        for (int i = 0; i <= bigNum.length() - 2; i++) {
            for (int j = i+2; j <= bigNum.length(); j++) {
                String sub = bigNum.substring(i,j);
                long tmp = Long.parseLong(sub)%22;
                if(tmp==0){
                    total+=1;
                }
            }
        }
        System.out.println(total);
    }


}
